Complexity Notation¶
links: AC2 TOC - Number-Theoretic Algorithms and Hardness Assumptions - Index
Different algorithmic complexities¶
From fast to slow
- Constant time - Logarithmic time - Square root time - Linear time - Linear logarithmic time - Quadratic time - Cubic time - Polynomial time - Exponential time - Factorial time - "Crazy" exponential time
From the slides:
Notation¶
For some function
- Big O notation:
- Upper bound. Worst case scenario. (Less or equal) - Little o notation:
- Upper bound. Worst case scenario. (Strictly less) - Big Omega notation:
- Lower bound. Best case scenario. (Greater or equal) - Little omega notation:
- Lower bound. Best case scenario. (Strictly greater) - Big Theta notation:
- Equal. Average case scenario.
Master Theorem¶
To analyse recursive function we need the Master Theorem.
Decrease (R1-2) the problem size by
Divide (D1-4) the problem size by
links: AC2 TOC - Number-Theoretic Algorithms and Hardness Assumptions - Index